package com.syb.util;

import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;

import org.apache.commons.lang.StringUtils;
/**
 * 
 * @author youkun
 * @see 读取配置文件信息
 */

public class ReadResourceUtil {
	
	public static String getRedResource(String fileName,String key) throws Exception{
		if(StringUtils.isEmpty(fileName)){
			throw new Exception("fileName is empty");
		}
		if(StringUtils.isEmpty(key)){
			throw new Exception("key is empty");
		}
		ResourceBundle rb = ResourceBundle.getBundle(fileName);
		return rb.getString(key);
	}

	public static void main(String arg[]){
		List<String> aa = new ArrayList<String>();
		aa.add("aa");
		aa.add("bb");
		String[] s = new String[aa.size()];
		aa.toArray(s);
		for(int i=0;i<s.length;i++){
		System.out.print(s[i]);
		}
		
	}
}
